package com.bida.mapper;

import com.bida.domain.po.Setmeal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bida.domain.vo.DishItemVO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 套餐 Mapper 接口
 * </p>
 *
 * @author ly
 * @since 2024-09-06
 */
public interface SetmealMapper extends BaseMapper<Setmeal> {

    List<Setmeal> getAllList(Setmeal setmeal);

    /**
     * 根据套餐id查询菜品选项
     * @param setmealId
     * @return
     */
    @Select("select sd.name, sd.copies, d.image, d.description " +
            "from setmeal_dish sd left join dish d on sd.dish_id = d.id " +
            "where sd.setmeal_id = #{setmealId}")
    List<DishItemVO> getDishItemBySetmealId(Long setmealId);
}
